<%@ page contentType="text/html; charset=utf-8" language="java"  errorPage="" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>档案信息管理</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}

-->
</style>
<script type='text/javascript' src='/dwr/util.js'></script>
<script type="text/javascript">
var  highlightcolor='#d5f4fe';
//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
var  clickcolor='#51b2f6';
function  changeto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=highlightcolor;
}
}

function  changeback(){
if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function  clickto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=clickcolor;
}
else
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}




//add by lihui 翻页提交
function toPage()
{
  if(isNaN(document.all.page.value)){
    alert("跳转页面只能为数字！");
    return false;
  }
  document.all.archiveSearch.action="/archive/archiveManager.do?action=list";
  document.all.archiveSearch.submit();

}

function checkAll()  
{   
    var chk=document.getElementsByName("id");   
    for(var i=0;i<chk.length;i++)   
     {   
        if(chk(i).checked==true){
           chk(i).checked=false; 
        }else{
           chk(i).checked=true;
        }
     }      
}


function del(id){
 if(id!=null){
     if(confirm("确认删除？"))
        {
           document.all.archiveSearch.action="/archive/archiveManager.do?action=setdeleted&id="+id;
           document.all.archiveSearch.submit();
        }else{
          return false;
        } 
  }else{
    if(isChecked('id'))
    {
        if(confirm("确认删除？"))
        {
           document.all.archiveSearch.action="/archive/archiveManager.do?action=setdeleted";
           document.all.archiveSearch.submit();
        }else{
          return false;
        }  
    }else{
      alert('请选择要删除的项目');
      return false;
    }
  }
}


function isChecked(name){
   var chk = document.getElementsByName('id');
   var result = false;
   for(var i=0;i<chk.length;i++){
       if(chk(i).checked==true){
          result = true; 
        }
   }
   return result;
}

</script>


</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
 <form id="archiveSearch" name="archiveSearch" method="post" action="/archive/archiveManager.do?action=list">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="../images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 档案信息列表</span></td>
              </tr>
            </table></td>
            <td><div align="right"><span class="STYLE1">
              <input type="checkbox" name="checkbox11" id="checkbox11" onclick="javascript:checkAll()" />
              全选      &nbsp;&nbsp;<img src="../images/add.gif" width="10" height="10" /> <a href="/archive/addArchive.do?action=init"  style="color:#e1e2e3">添加</a>   &nbsp; <img src="../images/del.gif" width="10" height="10" /> <a href="javascript:" onclick="javascript:del();" style="color:#e1e2e3">删除</a>    &nbsp;&nbsp;   &nbsp;</span><span class="STYLE1"> &nbsp;</span></div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce" onmouseover="changeto()"  onmouseout="changeback()">
      <tr>
        <td width="4%" height="20" bgcolor="d3eaef" class="STYLE10"><div align="center">
          <input type="checkbox" name="checkbox" id="checkbox" />
        </div></td>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">文件提名</span></div></td>
        <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">份数</span></div></td>
        <td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">档案种类</span></div></td>
        <td width="16%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">文件种类</span></div></td>
        <td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">基本操作</span></div></td>
      </tr>
      <logic:notEmpty name="list">
      <logic:iterate id="archive" name="list">
      <tr>
        <td height="20" bgcolor="#FFFFFF"><div align="center">
          <input type="checkbox" name="id" value='<bean:write name="archive" property="id"/>' />
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE6"><div align="center"><span class="STYLE19"><bean:write name="archive" property="title"/></span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><bean:write name="archive" property="copys"/></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><bean:write name="archive" property="archivetype"/></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><bean:write name="archive" property="filetype"/></div></td>
        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21"><a href="javascript:" onclick="javascript:del('<bean:write name="archive" property="id"/>')">删除</a> | <a href="/archive/updateArchive.do?action=init&id=<bean:write name="archive" property="id"/>" >编辑</a> | <a href="/archive/archiveManager.do?action=view&id=<bean:write name="archive" property="id"/>" >查看</a></div></td>
      </tr>
      </logic:iterate>
      </logic:notEmpty>
    </table></td>
  </tr>
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="33%"><div align="left"><span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong> <bean:write name="p" property="totalCount"/></strong> 条记录，当前第<strong> <bean:write name="p" property="currPage"/></strong> 页，共 <strong><bean:write name="p" property="totalPage"/></strong> 页</span></div></td>
        <td width="67%"><table width="312" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td width="49"><div align="center"><a href="/archive/archiveManager.do?action=list"><img src="/images/main_54.gif" width="40" height="15" border="0"/></a></div></td>
            <td width="49"><div align="center"><logic:equal value="true" name="p" property="hasPreviousPage"><a href="/archive/archiveManager.do?action=list&page=<bean:write name="p" property="previousPage"/>"><img src="/images/main_56.gif" width="45" height="15" border="0"/></a></logic:equal><logic:notEqual value="true" name="p" property="hasPreviousPage"><img src="/images/main_56.gif" width="45" height="15" border="0"/></logic:notEqual></div></td>
            <td width="49"><div align="center"><logic:equal value="true" name="p" property="hasNextPage"><a href="/archive/archiveManager.do?action=list&page=<bean:write name="p" property="nextPage"/>"><img src="/images/main_58.gif" width="45" height="15" border="0" /></a></logic:equal><logic:notEqual value="true" name="p" property="hasNextPage"><img src="/images/main_58.gif" width="45" height="15" border="0" /></logic:notEqual></div></td>
            <td width="49"><div align="center"><a href="/archive/archiveManager.do?action=list&page=<bean:write name="p" property="totalPage"/>"><img src="/images/main_60.gif" width="40" height="15" border="0"/></a></div></td>
            <td width="37" class="STYLE22"><div align="center">转到</div></td>
            <td width="22"><div align="center">
              <input type="text" name="page" id="page" value='<bean:write name="p" property="currPage"/>'  style="width:20px; height:12px; font-size:12px; border:solid 1px #7aaebd;"  />
            </div></td>
            <td width="22" class="STYLE22"><div align="center">页</div></td>
            <td width="35"><img src="../images/main_62.gif" width="26" height="15" onclick="javascript:toPage();" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  </form>
</table>
</body>
</html>
